var express = require('express');
var http = require('http');
var session = require('express-session');

var app = express(),
    server = http.createServer(app).listen(8000),
    io = require('socket.io').listen(server);


//中间件
app.use('/static',express.static('myself/client'));
app.use(function () {

});
// app.use(session({
//     secret:'secret',
//     resave:true,
//     saveUninitialized:false,
//     cookie:{
//         maxAge:1000*60*10  //设置过期时间10min(单位毫秒)
//     }
// }));

//socket.io
io.sockets.on('connection',function (socket) {
    

});


// var mysql      = require('mysql');
// var connection = mysql.createConnection({
//     host     : 'localhost',
//     user     : 'dbuser',
//     password : 's3kreee7'
// });
// connection.connect();
// connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
//     if (err) throw err;
//     console.log('The solution is: ', rows[0].solution);
// });
// connection.end();
